home *** CD-ROM | disk | FTP | other *** search
- on dragItem hVals, snapV, useNextMember, constrainSprite
- global mySprite
- set startH to the locH of sprite mySprite
- set startV to the locV of sprite mySprite
- if paramCount() < 3 then
- set useNextMember to 0
- end if
- if paramCount() >= 4 then
- set the constraint of sprite mySprite to constrainSprite
- end if
- if not listp(hVals) then
- set snapH to hVals
- set hVals to list(hVals)
- end if
- puppetSound(0)
- repeat while the stillDown
- set x to the mouseH
- set y to the mouseV
- set snapped to 0
- repeat with snapH in hVals
- if inside(point(x, y), rect(snapH - 70, snapV - 35, snapH + 70, snapV + 35)) then
- set snapped to 1
- if (the locH of sprite mySprite <> snapH) or (the locV of sprite mySprite <> snapV) then
- puppetSound("poper")
- set the visible of sprite 20 to 1
- set the locH of sprite mySprite to snapH
- set the locV of sprite mySprite to snapV
- end if
- end if
- end repeat
- if not snapped then
- set the locH of sprite mySprite to the mouseH
- set the locV of sprite mySprite to the mouseV
- set the visible of sprite 20 to 0
- end if
- updateStage()
- end repeat
- set the constraint of sprite mySprite to 0
- if not snapped then
- return 0
- else
- return 1
- end if
- end
-